<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="DicType" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<alias>
    <typeAlias alias="DicType" type="EIA.Basic.Model.DicType, EIA.Basic.Model" />
</alias>

<resultMaps>
<resultMap id="select-dictype-result" class="DicType">
<constructor>
    <argument argumentName="dic_tid" column="dic_tid"/>
    <argument argumentName="_type" column="_type"/>
    <argument argumentName="dic_name" column="dic_name"/>
    <argument argumentName="dic_des" column="dic_des"/>
</constructor>
<!--
    <result property="DicTid" column="dic_tid"/>
    <result property="Type" column="_type"/>
    <result property="DicName" column="dic_name"/>
    <result property="DicDes" column="dic_des"/>
-->
</resultMap>
</resultMaps>

<statements>
<sql id="sql_DicType_where_pk">
WHERE dic_tid=#DicTid#
</sql>

<sql id="sql_DicType_where_cv">
<dynamic prepend="WHERE">
    <isPropertyAvailable property="DicTid" prepend="AND">dic_tid LIKE concat('%', #DicTid#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="Type" prepend="AND">_type=#Type#</isPropertyAvailable>
    <isPropertyAvailable property="DicName" prepend="AND">dic_name LIKE concat('%', #DicName#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="DicDes" prepend="AND">dic_des LIKE concat('%', #DicDes#, '%')</isPropertyAvailable>
</dynamic>
</sql>

<sql id="sql_DicType_set_cols">
<dynamic prepend="SET">
    <isPropertyAvailable property="Type" prepend=",">_type=#Type#</isPropertyAvailable>
    <isPropertyAvailable property="DicName" prepend=",">dic_name=#DicName#</isPropertyAvailable>
    <isPropertyAvailable property="DicDes" prepend=",">dic_des=#DicDes#</isPropertyAvailable>
</dynamic>
</sql>

<select id="SelectDicType" parameterClass="" resultMap="DicType.select-dictype-result">
SELECT *
FROM dic_type
<include refid="sql_DicType_where_pk"/><!--where-->
</select>

<select id="SelectDicType_CV" parameterClass="System.Collections.IDictionary" resultMap="DicType.select-dictype-result">
SELECT *
FROM dic_type
<include refid="sql_DicType_where_cv"/><!--where-->
</select>

<insert id="InsertDicType" parameterClass="DicType">
<!--pre selectKey place-->
INSERT INTO dic_type(
<dynamic prepend=" ">
    <isPropertyAvailable property="DicTid" prepend=",">dic_tid</isPropertyAvailable>
    <isPropertyAvailable property="Type" prepend=",">_type</isPropertyAvailable>
    <isPropertyAvailable property="DicName" prepend=",">dic_name</isPropertyAvailable>
    <isPropertyAvailable property="DicDes" prepend=",">dic_des</isPropertyAvailable>
</dynamic>
)VALUES(
<dynamic prepend=" ">
    <isPropertyAvailable property="DicTid" prepend=",">#DicTid#</isPropertyAvailable>
    <isPropertyAvailable property="Type" prepend=",">#Type#</isPropertyAvailable>
    <isPropertyAvailable property="DicName" prepend=",">#DicName#</isPropertyAvailable>
    <isPropertyAvailable property="DicDes" prepend=",">#DicDes#</isPropertyAvailable>
</dynamic>
)
<!--post selectKey place-->
</insert>

<update id="UpdateDicType" parameterClass="System.Collections.IDictionary">
UPDATE dic_type
<include refid="sql_DicType_set_cols"/><!--set-->
<include refid="sql_DicType_where_pk"/><!--where-->
</update>

<delete id="DeleteDicType" parameterClass="">
DELETE FROM dic_type
<include refid="sql_DicType_where_pk"/><!--where-->
</delete>

<statement id="DeleteDicType_CV" parameterClass="DicType">
DELETE FROM dic_type
<include refid="sql_DicType_where_cv"/><!--where-->
</statement>

<delete id="ClearDicType">
DELETE FROM dic_type
</delete>
</statements>
</sqlMap>